﻿<UserControl x:Class="LiveTiss.Guias.UserControls.CabecalhoSolicitacao"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:guia="clr-namespace:LiveTiss.Guias"
    xmlns:converter="clr-namespace:LiveTiss.Classes.TypeConverter"      
    xmlns:uc="clr-namespace:LiveTiss.Guias.UserControls" 
    x:Name="root" Width="910">

    <UserControl.Resources>
        <converter:ByteToImageConverter x:Key="byteToImageConverter" />
    </UserControl.Resources>

    <StackPanel Width="910">
        <Grid x:Name="Header" Height="92" Margin="0,0,0,0" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="90.5"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Rectangle x:Name="PlaceHolder_Logo" Fill="#FFF4F4F5" Margin="0" Stroke="Black" Width="80" Height="80" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <Image Name="imgLogoPrestadora" Margin="1,0,0,0" Width="78" Height="78" HorizontalAlignment="Center" VerticalAlignment="Center"
                           Source="{Binding Path=Value.LogoPrestadora,Converter={StaticResource byteToImageConverter},BindsDirectlyToSource=True,ElementName=root,NotifyOnValidationError=True}"/>
            <TextBlock x:Name="Tipo_de_Guia" TextWrapping="Wrap" VerticalAlignment="Top" Grid.Column="1" Margin="8.5,4,5,0" Height="51" FontSize="24"
                       Text="{Binding Path=TituloGuia,ElementName=root}" />
            <TextBlock x:Name="Numero" TextWrapping="Wrap" Text="nº:" Grid.Column="1" Margin="6.5,59,9,0" FontSize="16" Height="27" VerticalAlignment="Top"/>
            <TextBox Name="txtNumeroGuia" Height="25" Margin="49.5,59,0,8" Width="415" Grid.Column="1" HorizontalAlignment="Left" IsReadOnly="True" MaxLength="20" 
                     Text="{Binding Path=Value.numeroGuiaPrestador,ElementName=root, Mode=TwoWay,ValidatesOnDataErrors=True,NotifyOnValidationError=True}" />
        </Grid>
        <Grid x:Name="Agrupamento" Margin="0,19,0,0" VerticalAlignment="Top">
            <Rectangle x:Name="Contorno" RadiusY="6" RadiusX="6" Stroke="#4D898989"/>
            <StackPanel x:Name="Conteudo_Agrupamento" Margin="12,4,8,0">
                <uc:CabecalhoSolicitacaoIdentificacaoFontePagadora x:Name="idFontePagadora" 
                    Value="{Binding Path=Value.identificacaoFontePagadora,ElementName=root,Mode=TwoWay,ValidatesOnDataErrors=True,NotifyOnValidationError=True}"/>
                <Grid Margin="0,0,6,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Data de Emissão da Guia:" FontFamily="Segoe UI" FontSize="13.333"/>
                        <sdk:DatePicker Name="dtpEmissao" HorizontalAlignment="Left" Margin="0,6,0,0" SelectedDateFormat="Short"
                                        SelectedDate="{Binding Path=Value._dataEmissaoGuia,ElementName=root,Mode=TwoWay,ValidatesOnDataErrors=True, BindsDirectlyToSource=True}" />
                    </StackPanel>
                    <TextBlock x:Name="Opcional" TextWrapping="Wrap" Text="*" FontFamily="Segoe UI" FontWeight="Bold" FontSize="21.333" Foreground="#FF307852" Height="16" VerticalAlignment="Top" Margin="0,0,3,0" d:LayoutOverrides="Width"/>
                </Grid>
            </StackPanel>
        </Grid>
    </StackPanel>
</UserControl>
